export default ({ request }) => ({
  /**
   * 上传文件
   * @param {*} file 文件
   * @returns 
   */
  UPLOAD_FILE(file){
    let formData = new FormData();
    formData.append('Filedata', file);
    return request({
      url: "/budwk/platform/pub/file/upload/file",
      method: "post",
      data: formData,
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    });
  },
  /**
   * 获取前段加密用参数
   * @returns 
   */
  GET_LOGIN_RSA() {
    return request({ url: "/budwk/ucenter/auth/rsa" });
  },
  /**
   * 获取验证码
   * @returns 
   */
  GET_CAPTCHA() {
    return request({ url: "/budwk/ucenter/auth/captcha" });
  },
  /**
   * @description 用户登陆
   * @param {Object} data
   * @returns 
   */
  USER_LOGIN(data) {
    return request({
      url: "/budwk/ucenter/auth/login",
      method: "post",
      data: data,
    });
  },
  /**
   * @description 修改用户密码
   * @param {Object} data
   * @returns 
   */
  CHANGE_USER_PWD(data) {
    return request({
      url: "/budwk/platform/home/user/pwd",
      method: "post",
      data: data,
    });
  },
  /**
   * 获取应用信息
   * @returns 
   */
  GET_APP_INFO() {
    return request({ url: "/budwk/ucenter/auth/info?appId=SMARTLC" });
  },
  /**
   * 获取应用通知
   * @returns 
   */
  GET_APP_NOTICE() {
    return request({ url: "/budwk/smartlc/lc/taskmng/notice", method: "post" });
  },
  /**
   * 检车u用户名是否存在
   * @returns 
   */
  CHECK_USER_EXIST(data) {
    return request({
      url: "/budwk/auth/check/loginname",
      method: "post",
      data: data
    });
  },
  /**
   * 发送修改密码验证码
   * @returns 
   */
  SEND_CHANGE_PWD_CODE(data) {
    return request({
      url: "/budwk/auth/pwd/sendcode",
      method: "post",
      data: data
    });
  },
  /**
   * 保存密码
   * @param {*} data 
   * @returns 
   */
  SAVE_NEW_PWD(data) {
    return request({
      url: "/budwk/auth/pwd/save",
      method: "post",
      data: data
    });
  },
});
